import { baseRequest } from "@/utils/request";

const request = (url, ...arg) => baseRequest(`/api/bizapp/biz/admin/goods/` + url, ...arg);

/**
 * 商品Api接口管理器
 *
 * @author Lancer
 * @date  2024/03/03 17:37
 **/
export default {
	// 获取商品分页
	bizGoodsPage(data) {
		return request("page", data, "get");
	},
	// 提交商品表单 edit为true时为编辑，默认为新增
	bizGoodsSubmitForm(data, edit = false) {
		return request(edit ? "edit" : "add", data, "formdata");
	},
	// 删除商品
	bizGoodsDelete(data) {
		return request("delete", data);
	},
	// 获取商品详情
	bizGoodsDetail(data) {
		return request("detail", data, "get");
	},
	getINTRODUCTIONAttr(data) {
		return request("getINTRODUCTIONAttr", data, "get");
	},
	getSTANDARDSAttr(data) {
		return request("getSTANDARDSAttr", data, "get");
	},
	UpdateINTRODUCTIONAttr(data) {
		return request("UpdateINTRODUCTIONAttr", data, "post");
	},
	UpdateSTANDARDSAttr(data) {
		return request("UpdateSTANDARDSAttr", data, "post");
	}
};
